package vns.client.event;

import vns.shared.ObjectTypeDTO;

import com.google.gwt.event.shared.GwtEvent;

public class ObjectEvent extends GwtEvent<ObjectEventHandler> {

	public static Type<ObjectEventHandler> TYPE = new Type<ObjectEventHandler>();
	private ObjectTypeDTO objectTypeDTO; 
	
	public ObjectEvent(ObjectTypeDTO o){
		this.objectTypeDTO = o;
	}
	
	@Override
	public Type<ObjectEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(ObjectEventHandler handler) {
		handler.onLoad(this);
	}

	public void setObjectTypeDTO(ObjectTypeDTO objectTypeDTO) {
		this.objectTypeDTO = objectTypeDTO;
	}

	public ObjectTypeDTO getObjectTypeDTO() {
		return objectTypeDTO;
	}

}
